<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>计算器练习</title>
	</head>
	<body>
		<div id="app">
			数据A:<input  type="text" v-model="num1" 
			@keyup.enter="addnum"/><br />
			数据B:<input  type="text" v-model="num2"
			@keyup.enter="addnum"/><br />
			总数:	 <span v-text="count"></span>
		</div>
		
		<script src="../js/vue.js"></script>
		<script>
			const app = new Vue({
				el: "#app",
				data: {
					num1: '',
					num2: '',
					count: ''
				},
				//key:value 格式
				methods: {
						addnum(){
							this.count = parseInt(this.num1)+parseInt(this.num2)
						}
					}
			})
		</script>
	</body>
</html>
